#include "RecordConsumer.h"


RecordConsumer::RecordConsumer(void)
{
	_isRecord = false;
	_startTime = 0;
}

RecordConsumer::RecordConsumer( MusicNotation musicNotation )
{
	_musicNotation = musicNotation;
	_isRecord = false;
	_startTime = 0;
}


RecordConsumer::~RecordConsumer(void)
{
}

void RecordConsumer::handleEvent( const PianoKeyEvent& e )
{
	if(_isRecord)
		_musicNotation.addNewNote(e);
}

void RecordConsumer::startRecord()
{
	_isRecord = true;
	_startTime = clock();
	_musicNotation.setInitialTime(_startTime);
}

void RecordConsumer::stopRecord()
{
	_isRecord = false;
}

void RecordConsumer::setMusicNotation( MusicNotation musicNotation )
{
	_musicNotation = musicNotation;
}
